package com.flyco.modules.returns.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.flyco.modules.returns.entity.OmsOrderReturnItem;
import com.flyco.modules.returns.mapper.OmsOrderReturnItemMapper;
import com.flyco.modules.returns.service.IOmsOrderReturnItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 申请退换货明细
 * @Author: flyco
 * @Date:   2023-08-01
 * @Version: V1.0
 */
@Service
public class OmsOrderReturnItemServiceImpl extends ServiceImpl<OmsOrderReturnItemMapper, OmsOrderReturnItem> implements IOmsOrderReturnItemService {

    @Autowired
    private OmsOrderReturnItemMapper returnItemMapper;

    @Override
    public List<OmsOrderReturnItem> getByApplyId(Long applyId){

        LambdaQueryWrapper<OmsOrderReturnItem> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(OmsOrderReturnItem::getReturnApplyId,applyId);

        return returnItemMapper.selectList(wrapper);
    }

    @Override
    public List<OmsOrderReturnItem> getByApplyIdList(List<Long> applyIdList){

        LambdaQueryWrapper<OmsOrderReturnItem> wrapper=new LambdaQueryWrapper<>();
        wrapper.in(OmsOrderReturnItem::getReturnApplyId,applyIdList);

        return returnItemMapper.selectList(wrapper);
    }
}
